package org.example.chapter3;

public class Format {
    public static void main(String[] args) {
        System.out.printf("%,8d\t%,10.1f\n",12345678,12345678.263);
        System.out.println();
        System.out.printf("%5c",'a');
        System.out.println();
        System.out.printf("%6b\n",false);

        System.out.printf("%6b\n",true);

        System.out.printf("%10.2f\n",12345678.263);

        System.out.printf("%8d%8s%8.1f\n",1234,"java",5.63);
        System.out.printf("%-8d%-8s%-8.1f\n",1234,"java",5.63);

        System.out.println("------------------------");
        System.out.printf("%-10s%-10s%-10s%-10s%-10s\n","Degrees","Radians","Sine","Cosine","Tangent");
        int degrees = 30;
        double radians = Math.toRadians(degrees);
        System.out.printf("%-10d%-10.4f%-10.4f%-10.4f%-10.4f\n",degrees,radians,Math.sin(radians),Math.cos(radians),Math.tan(radians));

        degrees = 60;
        radians= Math.toRadians(degrees);
        System.out.printf("%-10d%-10.4f%-10.4f%-10.4f%-10.4f\n",degrees,radians,Math.sin(radians),Math.cos(radians),Math.tan(radians));

    }
}